package live.zs;

import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import java.util.List;

/**
 * @author madison
 * @description
 * @date 2022/2/7 13:29
 */
public class FruitResource {
    @Inject
    FruitService fruitService;


    @GET
    public List<Fruit> list() {
        return fruitService.list();
    }

    @POST
    public List<Fruit> add(Fruit fruit) {
        fruitService.add(fruit);
        return list();
    }
}
